package de.tc.stammdatenverwaltung.gui;

import de.tc.stammdatenverwaltung.gui.kontakthistory.Kontakthistorie;
import de.tc.stammdatenverwaltung.functions.commonFunctions;
import de.tc.stammdatenverwaltung.mailing.mailEditor;
import de.tc.stammdatenverwaltung.printing.druckeKontakt;
import java.awt.event.KeyEvent;
import java.sql.ResultSet;
import java.sql.Statement;
import java.util.Vector;
import javax.swing.JOptionPane;

public class Kontakt extends javax.swing.JDialog {

    private int flags = 0;
    protected String art = null;
    public int ID = -1;

    public Kontakt(java.awt.Frame parent, boolean modal, String Art, int id) {
      super(parent, modal);
      initComponents();

      this.art = Art;
      this.ID = id;

      clearInputs();

      //nur bei anzeige
      jButton6.setVisible(false);
      jButton7.setVisible(false);
      
      if (art.equalsIgnoreCase("show"))
      {
        jButton3.setVisible(false);
        jButton5.setVisible(false);
        jTextField1.setEditable(false);
        jTextField2.setEditable(false);
        jTextField3.setEditable(false);
        jTextField4.setEditable(false);
        jTextField5.setEditable(false);
        jTextField6.setEditable(false);
        jTextField7.setEditable(false);
        jTextField8.setEditable(false);
        jTextField9.setEditable(false);
        jTextField10.setEditable(false);
        jTextField11.setEditable(false);
        jTextField12.setEditable(false);
        jTextField13.setEditable(false);
        jTextField14.setEditable(false);
        jTextField15.setEditable(false);
        jTextField16.setEditable(false);
        jTextField17.setEditable(false);
        jTextField18.setEditable(false);
        jTextField19.setEditable(false);
        jTextField20.setEditable(false);
        jTextField21.setEditable(false);
        jTextField22.setEditable(false);
        jTextField23.setEditable(false);
        jTextField24.setEditable(false);
        jFormattedTextField1.setEditable(false);
        jCheckBox1.setEnabled(false);
        jCheckBox2.setEnabled(false);
        jCheckBox3.setEnabled(false);
        jCheckBox4.setEnabled(false);
        jCheckBox5.setEnabled(false);
        jButton6.setVisible(true);
        jButton7.setVisible(true);
      }
      else if (art.equalsIgnoreCase("neu"))
      {
        jButton3.setText("anlegen");
        jButton5.setVisible(false);
      }
      if (!art.equalsIgnoreCase("neu"))
      {
        loadData();

        if (art.equalsIgnoreCase("edit"))
          this.setTitle("Kontakt \""+ jTextField2.getText() + " " + jTextField4.getText() +"\" bearbeiten");
        else
        {
          if (art.equalsIgnoreCase("neu"))
            this.setTitle("Kontakt anlegen");
          else
            this.setTitle("Kontakt \""+ jTextField2.getText() + " " + jTextField4.getText() +"\" anzeigen");
        }
      }
    }

    protected void loadData()
    {
      try
      {
        Statement stmt = Main.con.createStatement();
        ResultSet rs = stmt.executeQuery(Main.selectSQL + " where ID =" + ID);

        if (rs.isBeforeFirst())
          rs.next();

        jTextField1.setText(rs.getString("TITEL"));
        jTextField2.setText(rs.getString("VNAME"));
        jTextField3.setText(rs.getString("NAME2"));
        jTextField4.setText(rs.getString("NNAME"));
        jTextField22.setText(rs.getString("NICK"));
        jFormattedTextField1.setText(rs.getString("BDAY2"));
        jTextField6.setText(rs.getString("ANSCHRIFT"));
        jTextField7.setText(rs.getString("PLZ_ORT"));
        jTextField8.setText(rs.getString("TEL"));
        jTextField9.setText(rs.getString("FAX"));
        jTextField10.setText(rs.getString("MOBIL"));
        jTextField11.setText(rs.getString("MAIL1"));
        jTextField12.setText(rs.getString("MAIL2"));
        jTextField13.setText(rs.getString("ABI2"));
        jTextField14.setText(rs.getString("AEMTER"));
        jTextField5.setText(rs.getString("FIRMA"));
        jTextField15.setText(rs.getString("RANG"));
        jTextField16.setText(rs.getString("BERUF"));
        jTextField18.setText(rs.getString("F_PLZ_ORT"));
        jTextField19.setText(rs.getString("F_TEL"));
        jTextField21.setText(rs.getString("F_MAIL"));
        jTextField20.setText(rs.getString("F_FAX"));
        jTextField17.setText(rs.getString("ANREDE"));
        jTextField23.setText(rs.getString("F_ANSCHRIFT"));
        jTextField24.setText(rs.getString("TAGFIELD"));
        flags = rs.getInt("VEREIN");
        setFlags();
      }
      catch (Exception ex)
      {
        JOptionPane.showMessageDialog(this, "Kontakt lesen fehlgeschlagen: " + ex.getLocalizedMessage(), "Fehler!", JOptionPane.ERROR_MESSAGE);
        ex.printStackTrace();
      }
    }

    private void setFlags()
    {
      if ( (flags & 1) == 1) //Forum Thomanum
        jCheckBox1.setSelected(true);
      else
        jCheckBox1.setSelected(false);

      if ( (flags & 2) == 2) //Thomanerbund
        jCheckBox4.setSelected(true);
      else
        jCheckBox4.setSelected(false);

      if ( (flags & 4) == 4) //Förderkreis Thomanerchor
        jCheckBox2.setSelected(true);
      else
        jCheckBox2.setSelected(false);

      if ( (flags & 8) == 8) //Freund des Chores
        jCheckBox3.setSelected(true);
      else
        jCheckBox3.setSelected(false);

      if ( (flags & 16) == 16) //Alumnus
        jCheckBox5.setSelected(true);
      else
        jCheckBox5.setSelected(false);
      alumnusCheck();
    }

    private int getFlags()
    {
      int flag = 0;
      if (jCheckBox1.isSelected()) //Forum Thomanum
        flag += 1;
      if (jCheckBox4.isSelected()) //Thomanerbund
        flag += 2;
      if (jCheckBox2.isSelected()) //Förderkreis Thomanerchor
        flag += 4;
      if (jCheckBox3.isSelected()) //Freund des Chores
        flag += 8;
      if (jCheckBox5.isSelected()) //Alumnus
        flag += 16;
      return flag;
    }

    private void clearInputs()
    {
      jTextField1.setText("");
      jTextField2.setText("");
      jTextField3.setText("");
      jTextField4.setText("");
      jTextField5.setText("");
      jTextField6.setText("");
      jTextField7.setText("");
      jTextField8.setText("");
      jTextField9.setText("");
      jTextField10.setText("");
      jTextField11.setText("");
      jTextField12.setText("");
      jTextField13.setText("");
      jTextField14.setText("");
      jTextField15.setText("");
      jTextField16.setText("");
      jTextField18.setText("");
      jTextField19.setText("");
      jTextField20.setText("");
      jTextField21.setText("");
      jTextField22.setText("");
      jTextField17.setText("");
      jTextField23.setText("");
      jTextField24.setText("");
      
      jCheckBox1.setSelected(false);
      jCheckBox2.setSelected(false);
      jCheckBox3.setSelected(false);
      jCheckBox4.setSelected(false);
      jCheckBox5.setSelected(false);

      alumnusCheck();
    }

    protected void mkInsert()
    {
      String insertSQL_flds = "INSERT INTO STAMMDATEN (";
      String insertSQL_vals  = "VALUES (";

      boolean kommaNoetig = false;
      int verein = getFlags();
      
      if (!commonFunctions.stringIsEmpty(jTextField1.getText()))
      {
        insertSQL_flds += "TITEL";
        insertSQL_vals += "'" + commonFunctions.sqlSichern(jTextField1.getText()) + "'";
        kommaNoetig = true;
      }
      if (!commonFunctions.stringIsEmpty(jTextField2.getText()))
      {
        if (kommaNoetig)
        {
          insertSQL_flds += ", ";
          insertSQL_vals += ", ";
        }
        insertSQL_flds += "VNAME";
        insertSQL_vals += "'" + commonFunctions.sqlSichern(jTextField2.getText()) + "'";
        kommaNoetig = true;
      }
      if (!commonFunctions.stringIsEmpty(jTextField3.getText()))
      {
        if (kommaNoetig)
        {
          insertSQL_flds += ", ";
          insertSQL_vals += ", ";
        }
        insertSQL_flds += "NAME2";
        insertSQL_vals += "'" + commonFunctions.sqlSichern(jTextField3.getText()) + "'";
        kommaNoetig = true;
      }
      if (!commonFunctions.stringIsEmpty(jTextField4.getText()))
      {
        if (kommaNoetig)
        {
          insertSQL_flds += ", ";
          insertSQL_vals += ", ";
        }
        insertSQL_flds += "NNAME";
        insertSQL_vals += "'" + commonFunctions.sqlSichern(jTextField4.getText()) + "'";
        kommaNoetig = true;
      }
      if (!commonFunctions.stringIsEmpty(jTextField22.getText()))
      {
        if (kommaNoetig)
        {
          insertSQL_flds += ", ";
          insertSQL_vals += ", ";
        }
        insertSQL_flds += "NICK";
        insertSQL_vals += "'" + commonFunctions.sqlSichern(jTextField22.getText()) + "'";
        kommaNoetig = true;
      }
      if (!commonFunctions.stringIsEmpty(jFormattedTextField1.getText())) //1, 2, 3
      {
        if (kommaNoetig)
        {
          insertSQL_flds += ", ";
          insertSQL_vals += ", ";
        }
        insertSQL_flds += "GEBURTSTAG";
        insertSQL_vals += "'" + commonFunctions.sqlSichern(jFormattedTextField1.getText()) + "'";
        kommaNoetig = true;
      }
      if (!commonFunctions.stringIsEmpty(jTextField6.getText()))
      {
        if (kommaNoetig)
        {
          insertSQL_flds += ", ";
          insertSQL_vals += ", ";
        }
        insertSQL_flds += "ANSCHRIFT";
        insertSQL_vals += "'" + commonFunctions.sqlSichern(jTextField6.getText()) + "'";
        kommaNoetig = true;
      }
      if (!commonFunctions.stringIsEmpty(jTextField7.getText()))
      {
        if (kommaNoetig)
        {
          insertSQL_flds += ", ";
          insertSQL_vals += ", ";
        }
        insertSQL_flds += "PLZ_ORT";
        insertSQL_vals += "'" + commonFunctions.sqlSichern(jTextField7.getText())  + "'";
        kommaNoetig = true;
      }
      if (!commonFunctions.stringIsEmpty(jTextField8.getText()))
      {
        if (kommaNoetig)
        {
          insertSQL_flds += ", ";
          insertSQL_vals += ", ";
        }
        insertSQL_flds += "TEL";
        insertSQL_vals += "'" + commonFunctions.sqlSichern(jTextField8.getText()) + "'";
        kommaNoetig = true;
      }
      if (!commonFunctions.stringIsEmpty(jTextField9.getText()))
      {
        if (kommaNoetig)
        {
          insertSQL_flds += ", ";
          insertSQL_vals += ", ";
        }
        insertSQL_flds += "FAX";
        insertSQL_vals += "'" + commonFunctions.sqlSichern(jTextField9.getText()) + "'";
        kommaNoetig = true;
      }
      if (!commonFunctions.stringIsEmpty(jTextField10.getText()))
      {
        if (kommaNoetig)
        {
          insertSQL_flds += ", ";
          insertSQL_vals += ", ";
        }
        insertSQL_flds += "MOBIL";
        insertSQL_vals += "'" + commonFunctions.sqlSichern(jTextField10.getText()) + "'";
        kommaNoetig = true;
      }
      if (!commonFunctions.stringIsEmpty(jTextField11.getText()))
      {
        if (kommaNoetig)
        {
          insertSQL_flds += ", ";
          insertSQL_vals += ", ";
        }
        insertSQL_flds += "MAIL1";
        insertSQL_vals += "'" + commonFunctions.sqlSichern(jTextField11.getText()) + "'";
        kommaNoetig = true;
      }
      if (!commonFunctions.stringIsEmpty(jTextField12.getText()))
      {
        if (kommaNoetig)
        {
          insertSQL_flds += ", ";
          insertSQL_vals += ", ";
        }
        insertSQL_flds += "MAIL2";
        insertSQL_vals += "'" + commonFunctions.sqlSichern(jTextField12.getText()) + "'";
        kommaNoetig = true;
      }
      if (!commonFunctions.stringIsEmpty(jTextField13.getText()))
      {
        if (kommaNoetig)
        {
          insertSQL_flds += ", ";
          insertSQL_vals += ", ";
        }
        insertSQL_flds += "ABITUR";
        insertSQL_vals += "'01.01." + commonFunctions.sqlSichern(jTextField13.getText()) + "'";
        kommaNoetig = true;
      }
      if (!commonFunctions.stringIsEmpty(jTextField14.getText()))
      {
        if (kommaNoetig)
        {
          insertSQL_flds += ", ";
          insertSQL_vals += ", ";
        }
        insertSQL_flds += "AEMTER";
        insertSQL_vals += "'" + commonFunctions.sqlSichern(jTextField14.getText()) + "'";
        kommaNoetig = true;
      }
      if (verein > 0)
      {
        if (kommaNoetig)
        {
          insertSQL_flds += ", ";
          insertSQL_vals += ", ";
        }
        insertSQL_flds += "VEREIN";
        insertSQL_vals += String.valueOf(verein);
        kommaNoetig = true;
      }
      if (!commonFunctions.stringIsEmpty(jTextField5.getText()))
      {
        if (kommaNoetig)
        {
          insertSQL_flds += ", ";
          insertSQL_vals += ", ";
        }
        insertSQL_flds += "FIRMA";
        insertSQL_vals += "'" + commonFunctions.sqlSichern(jTextField5.getText()) + "'";
        kommaNoetig = true;
      }
      if (!commonFunctions.stringIsEmpty(jTextField15.getText()))
      {
        if (kommaNoetig)
        {
          insertSQL_flds += ", ";
          insertSQL_vals += ", ";
        }
        insertSQL_flds += "RANG";
        insertSQL_vals += "'" + commonFunctions.sqlSichern(jTextField15.getText()) + "'";
        kommaNoetig = true;
      }
      if (!commonFunctions.stringIsEmpty(jTextField16.getText()))
      {
        if (kommaNoetig)
        {
          insertSQL_flds += ", ";
          insertSQL_vals += ", ";
        }
        insertSQL_flds += "BERUF";
        insertSQL_vals += "'" + commonFunctions.sqlSichern(jTextField16.getText())  + "'";
        kommaNoetig = true;
      }
      if (!commonFunctions.stringIsEmpty(jTextField18.getText()))
      {
        if (kommaNoetig)
        {
          insertSQL_flds += ", ";
          insertSQL_vals += ", ";
        }
        insertSQL_flds += "F_PLZ_ORT";
        insertSQL_vals += "'" + commonFunctions.sqlSichern(jTextField18.getText()) + "'";
        kommaNoetig = true;
      }
      if (!commonFunctions.stringIsEmpty(jTextField19.getText()))
      {
        if (kommaNoetig)
        {
          insertSQL_flds += ", ";
          insertSQL_vals += ", ";
        }
        insertSQL_flds += "F_TEL";
        insertSQL_vals += "'" + commonFunctions.sqlSichern(jTextField19.getText()) + "'";
        kommaNoetig = true;
      }
      if (!commonFunctions.stringIsEmpty(jTextField20.getText()))
      {
        if (kommaNoetig)
        {
          insertSQL_flds += ", ";
          insertSQL_vals += ", ";
        }
        insertSQL_flds += "F_FAX";
        insertSQL_vals += "'" + commonFunctions.sqlSichern(jTextField20.getText())  + "'";
        kommaNoetig = true;
      }
      if (!commonFunctions.stringIsEmpty(jTextField21.getText()))
      {
        if (kommaNoetig)
        {
          insertSQL_flds += ", ";
          insertSQL_vals += ", ";
        }
        insertSQL_flds += "F_MAIL";
        insertSQL_vals += "'" + commonFunctions.sqlSichern(jTextField21.getText())  + "'";
        kommaNoetig = true;
      }
      if (!commonFunctions.stringIsEmpty(jTextField17.getText()))
      {
        if (kommaNoetig)
        {
          insertSQL_flds += ", ";
          insertSQL_vals += ", ";
        }
        insertSQL_flds += "ANREDE";
        insertSQL_vals += "'" + commonFunctions.sqlSichern(jTextField17.getText())  + "'";
        kommaNoetig = true;
      }
      if (!commonFunctions.stringIsEmpty(jTextField23.getText()))
      {
        if (kommaNoetig)
        {
          insertSQL_flds += ", ";
          insertSQL_vals += ", ";
        }
        insertSQL_flds += "F_ANSCHRIFT";
        insertSQL_vals += "'" + commonFunctions.sqlSichern(jTextField23.getText())  + "'";
        kommaNoetig = true;
      }
      if (!commonFunctions.stringIsEmpty(jTextField24.getText()))
      {
        if (kommaNoetig)
        {
          insertSQL_flds += ", ";
          insertSQL_vals += ", ";
        }
        insertSQL_flds += "TAGFIELD";
        insertSQL_vals += "'" + commonFunctions.sqlSichern(jTextField24.getText())  + "'";
      }

      String insertSQL =
        insertSQL_flds + ") " + insertSQL_vals + ")";

      try
      {
        System.out.println(insertSQL);
        Statement stmt = Main.con.createStatement();
        stmt.executeUpdate(insertSQL);
        JOptionPane.showMessageDialog(this, "Kontakt angelegt!", "Hinweis", JOptionPane.INFORMATION_MESSAGE);
      }
      catch (Exception ex)
      {
        JOptionPane.showMessageDialog(this, "Kontakt anlegen fehlgeschlagen: " + ex.getLocalizedMessage(), "Fehler!", JOptionPane.ERROR_MESSAGE);
        ex.printStackTrace();
      }
      //Main.load_query_to_table(Main.selectSQL, Main.jTable1);
    }

    protected void mkUpdate()
    {
      int verein = getFlags();
      boolean kommaNoetig = false;

      String updateSQL =
        "update stammdaten set ";
      updateSQL += "TITEL = '" + commonFunctions.sqlSichern(jTextField1.getText()) + "', ";
      updateSQL += "VNAME = '" + commonFunctions.sqlSichern(jTextField2.getText()) + "', ";
      updateSQL += "NAME2 = '" + commonFunctions.sqlSichern(jTextField3.getText()) + "', ";
      updateSQL += "NNAME = '" + commonFunctions.sqlSichern(jTextField4.getText()) + "', ";
      updateSQL += "NICK = '" + commonFunctions.sqlSichern(jTextField22.getText()) + "', ";
      if (jFormattedTextField1.getText().length() > 0)
        updateSQL += "GEBURTSTAG = '" + commonFunctions.sqlSichern(jFormattedTextField1.getText()) + "', ";
      else
        updateSQL += "GEBURTSTAG = null, ";
      updateSQL += "ANSCHRIFT = '" + commonFunctions.sqlSichern(jTextField6.getText()) + "', ";
      updateSQL += "PLZ_ORT = '" + commonFunctions.sqlSichern(jTextField7.getText())  + "', ";
      updateSQL += "TEL = '" + commonFunctions.sqlSichern(jTextField8.getText()) + "', ";
      updateSQL += "FAX = '" + commonFunctions.sqlSichern(jTextField9.getText()) + "', ";
      updateSQL += "MOBIL = '" + commonFunctions.sqlSichern(jTextField10.getText()) + "', ";
      updateSQL += "MAIL1 = '" + commonFunctions.sqlSichern(jTextField11.getText()) + "', ";
      updateSQL += "MAIL2 = '" + commonFunctions.sqlSichern(jTextField12.getText()) + "', ";
      if (jTextField13.getText().length() > 0)
        updateSQL += "ABITUR = ' 01.01." + commonFunctions.sqlSichern(jTextField13.getText()) + "', ";
      else
        updateSQL += "ABITUR = null, ";
      updateSQL += "AEMTER = '" + commonFunctions.sqlSichern(jTextField14.getText()) + "', ";
      updateSQL += "VEREIN = " + verein + ", ";
      updateSQL += "FIRMA = '" + commonFunctions.sqlSichern(jTextField5.getText()) + "', ";
      updateSQL += "RANG = '" + commonFunctions.sqlSichern(jTextField15.getText()) + "', ";
      updateSQL += "BERUF = '" + commonFunctions.sqlSichern(jTextField16.getText())  + "', ";
      updateSQL += "F_PLZ_ORT = '" + commonFunctions.sqlSichern(jTextField18.getText()) + "', ";
      updateSQL += "F_TEL = '" + commonFunctions.sqlSichern(jTextField19.getText()) + "', ";
      updateSQL += "F_FAX = '" + commonFunctions.sqlSichern(jTextField20.getText())  + "', ";
      updateSQL += "F_MAIL = '" + commonFunctions.sqlSichern(jTextField21.getText())  + "', ";

      updateSQL += "ANREDE = '" + commonFunctions.sqlSichern(jTextField17.getText()) + "', ";
      updateSQL += "F_ANSCHRIFT = '" + commonFunctions.sqlSichern(jTextField23.getText())  + "', ";
      updateSQL += "TAGFIELD = '" + commonFunctions.sqlSichern(jTextField24.getText())  + "'";

      updateSQL += " where ID = " + ID;
      System.out.println(updateSQL);
      try
      {
        Statement stmt = Main.con.createStatement();
        stmt.executeUpdate(updateSQL);
        JOptionPane.showMessageDialog(this, "Kontakt erfolgreich geändert!", "Hinweis", JOptionPane.INFORMATION_MESSAGE);
      }
      catch (Exception ex)
      {
        JOptionPane.showMessageDialog(this, "Kontakt ändern fehlgeschlagen: " + ex.getLocalizedMessage(), "Fehler!", JOptionPane.ERROR_MESSAGE);
        ex.printStackTrace();
      }
      //Main.load_query_to_table(Main.selectSQL, Main.jTable1);
    }


    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
  // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
  private void initComponents() {

    jPanel1 = new javax.swing.JPanel();
    jButton1 = new javax.swing.JButton();
    jButton2 = new javax.swing.JButton();
    jButton3 = new javax.swing.JButton();
    jButton5 = new javax.swing.JButton();
    jTabbedPane1 = new javax.swing.JTabbedPane();
    jPanel3 = new javax.swing.JPanel();
    jPanel2 = new javax.swing.JPanel();
    jLabel2 = new javax.swing.JLabel();
    jLabel3 = new javax.swing.JLabel();
    jLabel4 = new javax.swing.JLabel();
    jLabel5 = new javax.swing.JLabel();
    jLabel6 = new javax.swing.JLabel();
    jTextField1 = new javax.swing.JTextField();
    jTextField2 = new javax.swing.JTextField();
    jTextField3 = new javax.swing.JTextField();
    jTextField4 = new javax.swing.JTextField();
    jLabel1 = new javax.swing.JLabel();
    jTextField22 = new javax.swing.JTextField();
    jLabel24 = new javax.swing.JLabel();
    jTextField17 = new javax.swing.JTextField();
    jPanel4 = new javax.swing.JPanel();
    jLabel7 = new javax.swing.JLabel();
    jLabel8 = new javax.swing.JLabel();
    jLabel9 = new javax.swing.JLabel();
    jLabel10 = new javax.swing.JLabel();
    jLabel11 = new javax.swing.JLabel();
    jLabel12 = new javax.swing.JLabel();
    jLabel13 = new javax.swing.JLabel();
    jLabel14 = new javax.swing.JLabel();
    jTextField6 = new javax.swing.JTextField();
    jTextField7 = new javax.swing.JTextField();
    jTextField8 = new javax.swing.JTextField();
    jTextField9 = new javax.swing.JTextField();
    jTextField10 = new javax.swing.JTextField();
    jTextField11 = new javax.swing.JTextField();
    jTextField12 = new javax.swing.JTextField();
    jButton4 = new javax.swing.JButton();
    jButton6 = new javax.swing.JButton();
    jButton7 = new javax.swing.JButton();
    jPanel7 = new javax.swing.JPanel();
    jPanel8 = new javax.swing.JPanel();
    jLabel19 = new javax.swing.JLabel();
    jLabel20 = new javax.swing.JLabel();
    jLabel21 = new javax.swing.JLabel();
    jLabel22 = new javax.swing.JLabel();
    jTextField5 = new javax.swing.JTextField();
    jTextField15 = new javax.swing.JTextField();
    jTextField16 = new javax.swing.JTextField();
    jPanel9 = new javax.swing.JPanel();
    jLabel28 = new javax.swing.JLabel();
    jLabel23 = new javax.swing.JLabel();
    jLabel25 = new javax.swing.JLabel();
    jLabel27 = new javax.swing.JLabel();
    jLabel26 = new javax.swing.JLabel();
    jTextField18 = new javax.swing.JTextField();
    jTextField19 = new javax.swing.JTextField();
    jTextField20 = new javax.swing.JTextField();
    jTextField21 = new javax.swing.JTextField();
    jLabel30 = new javax.swing.JLabel();
    jTextField23 = new javax.swing.JTextField();
    jPanel10 = new javax.swing.JPanel();
    jPanel5 = new javax.swing.JPanel();
    jLabel15 = new javax.swing.JLabel();
    jLabel16 = new javax.swing.JLabel();
    jLabel17 = new javax.swing.JLabel();
    jPanel6 = new javax.swing.JPanel();
    jLabel18 = new javax.swing.JLabel();
    jCheckBox1 = new javax.swing.JCheckBox();
    jCheckBox2 = new javax.swing.JCheckBox();
    jCheckBox3 = new javax.swing.JCheckBox();
    jCheckBox4 = new javax.swing.JCheckBox();
    jTextField14 = new javax.swing.JTextField();
    jLabel29 = new javax.swing.JLabel();
    jCheckBox5 = new javax.swing.JCheckBox();
    jFormattedTextField1 = new javax.swing.JFormattedTextField();
    jTextField13 = new javax.swing.JTextField();
    jLabel31 = new javax.swing.JLabel();
    jTextField24 = new javax.swing.JTextField();

    setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
    addKeyListener(new java.awt.event.KeyAdapter() {
      public void keyTyped(java.awt.event.KeyEvent evt) {
        formKeyTyped(evt);
      }
    });

    jPanel1.addKeyListener(new java.awt.event.KeyAdapter() {
      public void keyPressed(java.awt.event.KeyEvent evt) {
        jPanel1KeyPressed(evt);
      }
    });

    jButton1.setText("<<<");
    jButton1.addActionListener(new java.awt.event.ActionListener() {
      public void actionPerformed(java.awt.event.ActionEvent evt) {
        jButton1ActionPerformed(evt);
      }
    });
    jButton1.addKeyListener(new java.awt.event.KeyAdapter() {
      public void keyPressed(java.awt.event.KeyEvent evt) {
        jButton1KeyPressed(evt);
      }
    });

    jButton2.setText(">>>");
    jButton2.addActionListener(new java.awt.event.ActionListener() {
      public void actionPerformed(java.awt.event.ActionEvent evt) {
        jButton2ActionPerformed(evt);
      }
    });

    jButton3.setText("Speichern");
    jButton3.addActionListener(new java.awt.event.ActionListener() {
      public void actionPerformed(java.awt.event.ActionEvent evt) {
        jButton3ActionPerformed(evt);
      }
    });

    jButton5.setText("Löschen");
    jButton5.addActionListener(new java.awt.event.ActionListener() {
      public void actionPerformed(java.awt.event.ActionEvent evt) {
        jButton5ActionPerformed(evt);
      }
    });

    javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
    jPanel1.setLayout(jPanel1Layout);
    jPanel1Layout.setHorizontalGroup(
      jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
      .addGroup(jPanel1Layout.createSequentialGroup()
        .addComponent(jButton1, javax.swing.GroupLayout.DEFAULT_SIZE, 65, Short.MAX_VALUE)
        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
        .addComponent(jButton3, javax.swing.GroupLayout.PREFERRED_SIZE, 166, javax.swing.GroupLayout.PREFERRED_SIZE)
        .addGap(18, 18, 18)
        .addComponent(jButton5, javax.swing.GroupLayout.PREFERRED_SIZE, 174, javax.swing.GroupLayout.PREFERRED_SIZE)
        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
        .addComponent(jButton2, javax.swing.GroupLayout.DEFAULT_SIZE, 66, Short.MAX_VALUE))
    );
    jPanel1Layout.setVerticalGroup(
      jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
      .addGroup(jPanel1Layout.createSequentialGroup()
        .addContainerGap()
        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
          .addComponent(jButton1)
          .addComponent(jButton2)
          .addComponent(jButton3)
          .addComponent(jButton5))
        .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
    );

    jTabbedPane1.setPreferredSize(new java.awt.Dimension(555, 550));

    jPanel3.setPreferredSize(new java.awt.Dimension(490, 600));

    jPanel2.setBorder(javax.swing.BorderFactory.createEtchedBorder());

    jLabel2.setText("Titel");

    jLabel3.setText("Vorname");

    jLabel4.setText("2. Name");

    jLabel5.setText("Name");

    jLabel6.setText("Spitzname");

    jTextField1.setText("jTextField1");

    jTextField2.setText("jTextField2");

    jTextField3.setText("jTextField3");

    jTextField4.setText("jTextField4");

    jLabel1.setFont(new java.awt.Font("Dialog", 1, 18));
    jLabel1.setText("Name");

    jTextField22.setText("jTextField22");

    jLabel24.setText("Anrede");

    jTextField17.setText("jTextField17");

    javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
    jPanel2.setLayout(jPanel2Layout);
    jPanel2Layout.setHorizontalGroup(
      jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
      .addGroup(jPanel2Layout.createSequentialGroup()
        .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
          .addComponent(jLabel1)
          .addGroup(jPanel2Layout.createSequentialGroup()
            .addContainerGap()
            .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
              .addComponent(jLabel5)
              .addComponent(jLabel6)
              .addComponent(jLabel4)
              .addComponent(jLabel3)
              .addComponent(jLabel2)
              .addComponent(jLabel24))
            .addGap(8, 8, 8)
            .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
              .addComponent(jTextField17, javax.swing.GroupLayout.DEFAULT_SIZE, 393, Short.MAX_VALUE)
              .addComponent(jTextField1, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 393, Short.MAX_VALUE)
              .addComponent(jTextField2, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 393, Short.MAX_VALUE)
              .addComponent(jTextField3, javax.swing.GroupLayout.DEFAULT_SIZE, 393, Short.MAX_VALUE)
              .addComponent(jTextField4, javax.swing.GroupLayout.DEFAULT_SIZE, 393, Short.MAX_VALUE)
              .addComponent(jTextField22, javax.swing.GroupLayout.DEFAULT_SIZE, 393, Short.MAX_VALUE))))
        .addContainerGap())
    );
    jPanel2Layout.setVerticalGroup(
      jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
      .addGroup(jPanel2Layout.createSequentialGroup()
        .addComponent(jLabel1)
        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
        .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
          .addComponent(jLabel24)
          .addComponent(jTextField17, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
        .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
          .addComponent(jLabel2)
          .addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
        .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
          .addComponent(jLabel3)
          .addComponent(jTextField2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
        .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
          .addComponent(jLabel4)
          .addComponent(jTextField3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
        .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
          .addComponent(jLabel5)
          .addComponent(jTextField4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
        .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
          .addComponent(jLabel6)
          .addComponent(jTextField22, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
        .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
    );

    jPanel4.setBorder(javax.swing.BorderFactory.createEtchedBorder());

    jLabel7.setFont(new java.awt.Font("Dialog", 1, 18));
    jLabel7.setText("Kontakt");

    jLabel8.setText("Anschrift");

    jLabel9.setText("PLZ / Ort");

    jLabel10.setText("Telefon");

    jLabel11.setText("Fax");

    jLabel12.setText("Mobil");

    jLabel13.setText("E-Mail 1");

    jLabel14.setText("E-Mail 2");

    jTextField6.setText("jTextField6");

    jTextField7.setText("jTextField7");

    jTextField8.setText("jTextField8");

    jTextField9.setText("jTextField9");

    jTextField10.setText("jTextField10");

    jTextField11.setText("jTextField11");

    jTextField12.setText("jTextField12");

    javax.swing.GroupLayout jPanel4Layout = new javax.swing.GroupLayout(jPanel4);
    jPanel4.setLayout(jPanel4Layout);
    jPanel4Layout.setHorizontalGroup(
      jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
      .addGroup(jPanel4Layout.createSequentialGroup()
        .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
          .addComponent(jLabel7)
          .addGroup(jPanel4Layout.createSequentialGroup()
            .addContainerGap()
            .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
              .addComponent(jLabel9)
              .addComponent(jLabel10)
              .addComponent(jLabel11)
              .addComponent(jLabel12)
              .addComponent(jLabel8))
            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
            .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
              .addComponent(jTextField6, javax.swing.GroupLayout.DEFAULT_SIZE, 395, Short.MAX_VALUE)
              .addComponent(jTextField8, javax.swing.GroupLayout.DEFAULT_SIZE, 395, Short.MAX_VALUE)
              .addComponent(jTextField7, javax.swing.GroupLayout.DEFAULT_SIZE, 395, Short.MAX_VALUE)
              .addComponent(jTextField9, javax.swing.GroupLayout.DEFAULT_SIZE, 395, Short.MAX_VALUE)
              .addComponent(jTextField10, javax.swing.GroupLayout.DEFAULT_SIZE, 395, Short.MAX_VALUE)
              .addComponent(jTextField11, javax.swing.GroupLayout.DEFAULT_SIZE, 395, Short.MAX_VALUE)
              .addComponent(jTextField12, javax.swing.GroupLayout.DEFAULT_SIZE, 395, Short.MAX_VALUE)))
          .addGroup(jPanel4Layout.createSequentialGroup()
            .addContainerGap()
            .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
              .addComponent(jLabel14)
              .addComponent(jLabel13))
            .addGap(95, 95, 95)))
        .addContainerGap())
    );
    jPanel4Layout.setVerticalGroup(
      jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
      .addGroup(jPanel4Layout.createSequentialGroup()
        .addComponent(jLabel7)
        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
        .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
          .addComponent(jLabel8)
          .addComponent(jTextField6, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
        .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
          .addComponent(jLabel9)
          .addComponent(jTextField7, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
        .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
          .addComponent(jLabel10)
          .addComponent(jTextField8, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
        .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
          .addComponent(jLabel11)
          .addComponent(jTextField9, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
        .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
          .addComponent(jLabel12)
          .addComponent(jTextField10, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
        .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
          .addComponent(jLabel13)
          .addComponent(jTextField11, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
        .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
          .addComponent(jLabel14)
          .addComponent(jTextField12, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
        .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
    );

    jButton4.setText("diesen Kontakt drucken ...");
    jButton4.addActionListener(new java.awt.event.ActionListener() {
      public void actionPerformed(java.awt.event.ActionEvent evt) {
        jButton4ActionPerformed(evt);
      }
    });

    jButton6.setText("E-Mail an diesen Kontakt");
    jButton6.addActionListener(new java.awt.event.ActionListener() {
      public void actionPerformed(java.awt.event.ActionEvent evt) {
        jButton6ActionPerformed(evt);
      }
    });

    jButton7.setText("Kontakthistorie");
    jButton7.addActionListener(new java.awt.event.ActionListener() {
      public void actionPerformed(java.awt.event.ActionEvent evt) {
        jButton7ActionPerformed(evt);
      }
    });

    javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3);
    jPanel3.setLayout(jPanel3Layout);
    jPanel3Layout.setHorizontalGroup(
      jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
      .addGroup(jPanel3Layout.createSequentialGroup()
        .addContainerGap()
        .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
          .addComponent(jPanel2, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
          .addComponent(jPanel4, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
          .addComponent(jButton4, javax.swing.GroupLayout.DEFAULT_SIZE, 504, Short.MAX_VALUE)
          .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel3Layout.createSequentialGroup()
            .addComponent(jButton6, javax.swing.GroupLayout.DEFAULT_SIZE, 243, Short.MAX_VALUE)
            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
            .addComponent(jButton7, javax.swing.GroupLayout.DEFAULT_SIZE, 249, Short.MAX_VALUE)))
        .addContainerGap())
    );
    jPanel3Layout.setVerticalGroup(
      jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
      .addGroup(jPanel3Layout.createSequentialGroup()
        .addContainerGap()
        .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
        .addComponent(jPanel4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
        .addGap(18, 18, 18)
        .addComponent(jButton4)
        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
        .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
          .addComponent(jButton6)
          .addComponent(jButton7))
        .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
    );

    jTabbedPane1.addTab("Privat", jPanel3);

    jPanel7.setPreferredSize(new java.awt.Dimension(550, 600));

    jPanel8.setBorder(javax.swing.BorderFactory.createEtchedBorder());

    jLabel19.setFont(new java.awt.Font("Dialog", 1, 18));
    jLabel19.setText("Allgemein");

    jLabel20.setText("Firma");

    jLabel21.setText("Position");

    jLabel22.setText("Beruf");

    jTextField5.setText("jTextField5");

    jTextField15.setText("jTextField15");

    jTextField16.setText("jTextField16");

    javax.swing.GroupLayout jPanel8Layout = new javax.swing.GroupLayout(jPanel8);
    jPanel8.setLayout(jPanel8Layout);
    jPanel8Layout.setHorizontalGroup(
      jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
      .addGroup(jPanel8Layout.createSequentialGroup()
        .addGroup(jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
          .addComponent(jLabel19)
          .addGroup(jPanel8Layout.createSequentialGroup()
            .addContainerGap()
            .addGroup(jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
              .addComponent(jLabel21)
              .addComponent(jLabel20)
              .addComponent(jLabel22))
            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
            .addGroup(jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
              .addComponent(jTextField5, javax.swing.GroupLayout.DEFAULT_SIZE, 406, Short.MAX_VALUE)
              .addComponent(jTextField15, javax.swing.GroupLayout.DEFAULT_SIZE, 406, Short.MAX_VALUE)
              .addComponent(jTextField16, javax.swing.GroupLayout.DEFAULT_SIZE, 406, Short.MAX_VALUE))))
        .addContainerGap())
    );
    jPanel8Layout.setVerticalGroup(
      jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
      .addGroup(jPanel8Layout.createSequentialGroup()
        .addComponent(jLabel19)
        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
        .addGroup(jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
          .addComponent(jLabel20)
          .addComponent(jTextField5, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
        .addGroup(jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
          .addComponent(jLabel21)
          .addComponent(jTextField15, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
        .addGroup(jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
          .addComponent(jLabel22)
          .addComponent(jTextField16, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
        .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
    );

    jPanel9.setBorder(javax.swing.BorderFactory.createEtchedBorder());

    jLabel28.setText("E-Mail");

    jLabel23.setFont(new java.awt.Font("Dialog", 1, 18));
    jLabel23.setText("Kontakt");

    jLabel25.setText("PLZ / Ort");

    jLabel27.setText("Fax");

    jLabel26.setText("Telefon");

    jTextField18.setText("jTextField18");

    jTextField19.setText("jTextField19");

    jTextField20.setText("jTextField20");

    jTextField21.setText("jTextField21");

    jLabel30.setText("Anschrift");

    jTextField23.setText("jTextField23");

    javax.swing.GroupLayout jPanel9Layout = new javax.swing.GroupLayout(jPanel9);
    jPanel9.setLayout(jPanel9Layout);
    jPanel9Layout.setHorizontalGroup(
      jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
      .addGroup(jPanel9Layout.createSequentialGroup()
        .addGroup(jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
          .addComponent(jLabel23)
          .addGroup(jPanel9Layout.createSequentialGroup()
            .addContainerGap()
            .addGroup(jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
              .addComponent(jLabel28)
              .addGroup(jPanel9Layout.createSequentialGroup()
                .addGroup(jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                  .addComponent(jLabel25)
                  .addComponent(jLabel26)
                  .addComponent(jLabel27)
                  .addComponent(jLabel30))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                  .addComponent(jTextField23, javax.swing.GroupLayout.DEFAULT_SIZE, 401, Short.MAX_VALUE)
                  .addComponent(jTextField21, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 401, Short.MAX_VALUE)
                  .addComponent(jTextField20, javax.swing.GroupLayout.DEFAULT_SIZE, 401, Short.MAX_VALUE)
                  .addComponent(jTextField19, javax.swing.GroupLayout.DEFAULT_SIZE, 401, Short.MAX_VALUE)
                  .addComponent(jTextField18, javax.swing.GroupLayout.DEFAULT_SIZE, 401, Short.MAX_VALUE))))))
        .addContainerGap())
    );
    jPanel9Layout.setVerticalGroup(
      jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
      .addGroup(jPanel9Layout.createSequentialGroup()
        .addComponent(jLabel23)
        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
        .addGroup(jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
          .addComponent(jLabel30)
          .addComponent(jTextField23, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
        .addGroup(jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
          .addComponent(jLabel25)
          .addComponent(jTextField18, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
        .addGroup(jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
          .addComponent(jLabel26)
          .addComponent(jTextField19, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
        .addGroup(jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
          .addComponent(jLabel27)
          .addComponent(jTextField20, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
        .addGroup(jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
          .addComponent(jLabel28)
          .addComponent(jTextField21, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
        .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
    );

    javax.swing.GroupLayout jPanel7Layout = new javax.swing.GroupLayout(jPanel7);
    jPanel7.setLayout(jPanel7Layout);
    jPanel7Layout.setHorizontalGroup(
      jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
      .addGroup(jPanel7Layout.createSequentialGroup()
        .addContainerGap()
        .addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
          .addComponent(jPanel9, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
          .addComponent(jPanel8, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        .addContainerGap())
    );
    jPanel7Layout.setVerticalGroup(
      jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
      .addGroup(jPanel7Layout.createSequentialGroup()
        .addContainerGap()
        .addComponent(jPanel8, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
        .addComponent(jPanel9, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
        .addContainerGap(211, Short.MAX_VALUE))
    );

    jTabbedPane1.addTab("Geschäftlich", jPanel7);

    jPanel10.setPreferredSize(new java.awt.Dimension(550, 600));

    jPanel5.setBorder(javax.swing.BorderFactory.createEtchedBorder());

    jLabel15.setFont(new java.awt.Font("Dialog", 1, 18));
    jLabel15.setText("Sonstiges");

    jLabel16.setText("Abitur");

    jLabel17.setText("Ämter");

    jPanel6.setBorder(javax.swing.BorderFactory.createEtchedBorder());

    jLabel18.setFont(new java.awt.Font("Dialog", 1, 18));
    jLabel18.setText("Vereine");

    jCheckBox1.setText("Forum Thomanum");

    jCheckBox2.setText("Förderkreis Thomancerchor");

    jCheckBox3.setText("Freund des Chores");

    jCheckBox4.setText("Thomanerbund");

    javax.swing.GroupLayout jPanel6Layout = new javax.swing.GroupLayout(jPanel6);
    jPanel6.setLayout(jPanel6Layout);
    jPanel6Layout.setHorizontalGroup(
      jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
      .addGroup(jPanel6Layout.createSequentialGroup()
        .addGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
          .addComponent(jLabel18)
          .addGroup(jPanel6Layout.createSequentialGroup()
            .addContainerGap()
            .addGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
              .addComponent(jCheckBox1)
              .addComponent(jCheckBox4))
            .addGap(18, 18, 18)
            .addGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
              .addComponent(jCheckBox3)
              .addComponent(jCheckBox2))))
        .addContainerGap(76, Short.MAX_VALUE))
    );
    jPanel6Layout.setVerticalGroup(
      jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
      .addGroup(jPanel6Layout.createSequentialGroup()
        .addComponent(jLabel18)
        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
        .addGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
          .addComponent(jCheckBox1)
          .addComponent(jCheckBox2))
        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
        .addGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
          .addComponent(jCheckBox4)
          .addComponent(jCheckBox3))
        .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
    );

    jTextField14.setText("jTextField14");

    jLabel29.setText("Geburtstag");

    jCheckBox5.setText("ist ein Alumnus");
    jCheckBox5.addActionListener(new java.awt.event.ActionListener() {
      public void actionPerformed(java.awt.event.ActionEvent evt) {
        jCheckBox5ActionPerformed(evt);
      }
    });

    jFormattedTextField1.setFormatterFactory(new javax.swing.text.DefaultFormatterFactory(new javax.swing.text.DateFormatter()));
    jFormattedTextField1.addFocusListener(new java.awt.event.FocusAdapter() {
      public void focusGained(java.awt.event.FocusEvent evt) {
        jFormattedTextField1FocusGained(evt);
      }
    });
    jFormattedTextField1.addKeyListener(new java.awt.event.KeyAdapter() {
      public void keyPressed(java.awt.event.KeyEvent evt) {
        jFormattedTextField1KeyPressed(evt);
      }
    });

    jTextField13.setText("jTextField13");

    jLabel31.setText("Markierung ('Tag')");

    jTextField24.setText("jTextField24");

    javax.swing.GroupLayout jPanel5Layout = new javax.swing.GroupLayout(jPanel5);
    jPanel5.setLayout(jPanel5Layout);
    jPanel5Layout.setHorizontalGroup(
      jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
      .addGroup(jPanel5Layout.createSequentialGroup()
        .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
          .addComponent(jLabel15)
          .addGroup(jPanel5Layout.createSequentialGroup()
            .addContainerGap()
            .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
              .addComponent(jLabel29)
              .addComponent(jLabel31))
            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
            .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
              .addComponent(jTextField24, javax.swing.GroupLayout.DEFAULT_SIZE, 329, Short.MAX_VALUE)
              .addComponent(jFormattedTextField1, javax.swing.GroupLayout.DEFAULT_SIZE, 329, Short.MAX_VALUE)))
          .addGroup(jPanel5Layout.createSequentialGroup()
            .addContainerGap()
            .addComponent(jCheckBox5))
          .addGroup(jPanel5Layout.createSequentialGroup()
            .addContainerGap()
            .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
              .addComponent(jPanel6, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
              .addGroup(jPanel5Layout.createSequentialGroup()
                .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                  .addComponent(jLabel16)
                  .addComponent(jLabel17))
                .addGap(36, 36, 36)
                .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                  .addComponent(jTextField13, javax.swing.GroupLayout.DEFAULT_SIZE, 397, Short.MAX_VALUE)
                  .addComponent(jTextField14, javax.swing.GroupLayout.DEFAULT_SIZE, 397, Short.MAX_VALUE))))))
        .addContainerGap())
    );
    jPanel5Layout.setVerticalGroup(
      jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
      .addGroup(jPanel5Layout.createSequentialGroup()
        .addComponent(jLabel15)
        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
        .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
          .addComponent(jLabel29)
          .addComponent(jFormattedTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
        .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
          .addComponent(jLabel31)
          .addComponent(jTextField24, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
        .addComponent(jCheckBox5)
        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
        .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
          .addComponent(jLabel16)
          .addComponent(jTextField13, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
        .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
          .addComponent(jLabel17)
          .addComponent(jTextField14, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
        .addComponent(jPanel6, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
        .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
    );

    javax.swing.GroupLayout jPanel10Layout = new javax.swing.GroupLayout(jPanel10);
    jPanel10.setLayout(jPanel10Layout);
    jPanel10Layout.setHorizontalGroup(
      jPanel10Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
      .addGroup(jPanel10Layout.createSequentialGroup()
        .addContainerGap()
        .addComponent(jPanel5, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
        .addContainerGap())
    );
    jPanel10Layout.setVerticalGroup(
      jPanel10Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
      .addGroup(jPanel10Layout.createSequentialGroup()
        .addContainerGap()
        .addComponent(jPanel5, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
        .addContainerGap(246, Short.MAX_VALUE))
    );

    jTabbedPane1.addTab("Sonstiges", jPanel10);

    javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
    getContentPane().setLayout(layout);
    layout.setHorizontalGroup(
      layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
      .addGroup(layout.createSequentialGroup()
        .addGap(10, 10, 10)
        .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
        .addGap(10, 10, 10))
      .addComponent(jTabbedPane1, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 533, Short.MAX_VALUE)
    );
    layout.setVerticalGroup(
      layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
      .addGroup(layout.createSequentialGroup()
        .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, 40, javax.swing.GroupLayout.PREFERRED_SIZE)
        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
        .addComponent(jTabbedPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 532, Short.MAX_VALUE))
    );

    pack();
  }// </editor-fold>//GEN-END:initComponents

    private void formKeyTyped(java.awt.event.KeyEvent evt)//GEN-FIRST:event_formKeyTyped
    {//GEN-HEADEREND:event_formKeyTyped
      if (evt.getKeyCode() == KeyEvent.VK_ESCAPE)// TODO add your handling code here:
        this.dispose();
    }//GEN-LAST:event_formKeyTyped

    private void jPanel1KeyPressed(java.awt.event.KeyEvent evt)//GEN-FIRST:event_jPanel1KeyPressed
    {//GEN-HEADEREND:event_jPanel1KeyPressed
     if (evt.getKeyCode() == KeyEvent.VK_ESCAPE)// TODO add your handling code here:
        this.dispose();
    }//GEN-LAST:event_jPanel1KeyPressed

    private void jButton1KeyPressed(java.awt.event.KeyEvent evt)//GEN-FIRST:event_jButton1KeyPressed
    {//GEN-HEADEREND:event_jButton1KeyPressed
      if (evt.getKeyCode() == KeyEvent.VK_ESCAPE)// TODO add your handling code here:
        this.dispose();
    }//GEN-LAST:event_jButton1KeyPressed

    private void jCheckBox5ActionPerformed(java.awt.event.ActionEvent evt)//GEN-FIRST:event_jCheckBox5ActionPerformed
    {//GEN-HEADEREND:event_jCheckBox5ActionPerformed
      alumnusCheck();
    }//GEN-LAST:event_jCheckBox5ActionPerformed

    private void jButton3ActionPerformed(java.awt.event.ActionEvent evt)//GEN-FIRST:event_jButton3ActionPerformed
    {//GEN-HEADEREND:event_jButton3ActionPerformed
      //ACHTUNG, ActionListener ist in Main in oeffneKontakt()
    }//GEN-LAST:event_jButton3ActionPerformed

    private void jButton2ActionPerformed(java.awt.event.ActionEvent evt)//GEN-FIRST:event_jButton2ActionPerformed
    {//GEN-HEADEREND:event_jButton2ActionPerformed
      int el = commonFunctions.markedElement.indexOf(ID);

      if ( (el + 1) < commonFunctions.markedElement.size() )
      {
        ID = commonFunctions.markedElement.get(el+1);
        loadData();
        alumnusCheck();
        if (art.equalsIgnoreCase("edit"))
          this.setTitle("Kontakt \""+ jTextField2.getText() + " " + jTextField4.getText() +"\" bearbeiten");
        else
          if (art.equalsIgnoreCase("show"))
            this.setTitle("Kontakt \""+ jTextField2.getText() + " " + jTextField4.getText() +"\" anzeigen");
      }
      else
      {
        if (!art.equalsIgnoreCase("show"))
        {
          art = "neu";
          jButton3.setText("Anlegen");
          jButton3.setVisible(true);
          jTextField1.setText("");
          jTextField2.setText("");
          jTextField3.setText("");
          jTextField4.setText("");
          jTextField5.setText("");
          jTextField6.setText("");
          jTextField7.setText("");
          jTextField8.setText("");
          jTextField9.setText("");
          jTextField10.setText("");
          jTextField11.setText("");
          jTextField12.setText("");
          jFormattedTextField1.setValue(System.currentTimeMillis());// setText("");
          jTextField14.setText("");
          jTextField15.setText("");
          jTextField16.setText("");
          jTextField18.setText("");
          jTextField19.setText("");
          jTextField20.setText("");
          jTextField21.setText("");
          jTextField22.setText("");
          jTextField13.setText("");
          jTextField17.setText("");
          jTextField23.setText("");
          jTextField24.setText("");
          //jFormattedTextField2.setText("");
          jCheckBox5.setSelected(false);
          alumnusCheck();
          jCheckBox1.setSelected(false);
          jCheckBox2.setSelected(false);
          jCheckBox3.setSelected(false);
          jCheckBox4.setSelected(false);
          this.setTitle("Kontakt anlegen");
        }
      }
    }//GEN-LAST:event_jButton2ActionPerformed

    private void jButton1ActionPerformed(java.awt.event.ActionEvent evt)//GEN-FIRST:event_jButton1ActionPerformed
    {//GEN-HEADEREND:event_jButton1ActionPerformed
      int el = commonFunctions.markedElement.indexOf(ID);
      if ( (el -1) >= 0)
      {
        ID = commonFunctions.markedElement.get(el-1);
        loadData();
        alumnusCheck();
        this.setTitle("Kontakt \""+ jTextField2.getText() + " " + jTextField4.getText() +"\" bearbeiten");

        if (art.equalsIgnoreCase("neu"))
        {
          art = "edit";
          jButton3.setText("Speichern");
        }
      }
    }//GEN-LAST:event_jButton1ActionPerformed

    private void jButton4ActionPerformed(java.awt.event.ActionEvent evt)//GEN-FIRST:event_jButton4ActionPerformed
    {//GEN-HEADEREND:event_jButton4ActionPerformed
      String[] values = new String[] {
        jTextField17.getText(),
        jTextField1.getText(), jTextField2.getText(),
        jTextField3.getText(), jTextField4.getText(),
        jTextField22.getText(), jTextField6.getText(),
        jTextField7.getText(), jTextField8.getText(),
        jTextField9.getText(), jTextField10.getText(), jTextField11.getText(),
        jTextField12.getText(), jTextField5.getText(),
        jTextField15.getText(), jTextField16.getText(),
        jTextField23.getText(),
        jTextField18.getText(), jTextField19.getText(),
        jTextField20.getText(), jTextField21.getText(),
        jFormattedTextField1.getText(), jTextField24.getText(),
        (jCheckBox5.isSelected()?"ja":"nein"),
        jTextField13.getText(), jTextField14.getText(),
        (jCheckBox1.isSelected()?"ja":"nein"),
        (jCheckBox4.isSelected()?"ja":"nein"),
        (jCheckBox2.isSelected()?"ja":"nein"),
        (jCheckBox3.isSelected()?"ja":"nein")
      };
      druckeKontakt.starteDruck(values);
    }//GEN-LAST:event_jButton4ActionPerformed

    private void jButton5ActionPerformed(java.awt.event.ActionEvent evt)//GEN-FIRST:event_jButton5ActionPerformed
    {//GEN-HEADEREND:event_jButton5ActionPerformed

    }//GEN-LAST:event_jButton5ActionPerformed

    private void jButton6ActionPerformed(java.awt.event.ActionEvent evt)//GEN-FIRST:event_jButton6ActionPerformed
    {//GEN-HEADEREND:event_jButton6ActionPerformed
      String an = "";

      String[] s = new String[]
      {
        jTextField11.getText(), //mail1
        jTextField12.getText(), //mail2
        jTextField21.getText() //fa_mail
      };
      
      for (int i = 0; i < s.length; i++)
      {
        if ( commonFunctions.isValidMail(s[i]) )
          an = s[i];
      }

      if ( an.length() > 0 )
      {
        Vector<String> v = new Vector<String>(1);
        v.add(an);
        mailEditor me = new mailEditor(null, true, v);
        me.setVisible(true);
      }
    }//GEN-LAST:event_jButton6ActionPerformed

    private void jButton7ActionPerformed(java.awt.event.ActionEvent evt)//GEN-FIRST:event_jButton7ActionPerformed
    {//GEN-HEADEREND:event_jButton7ActionPerformed
      Kontakthistorie kh = new Kontakthistorie(null, true, ID, jTextField2.getText() + " " + jTextField4.getText() );
      kh.setVisible(true);
    }//GEN-LAST:event_jButton7ActionPerformed

    private void jFormattedTextField1FocusGained(java.awt.event.FocusEvent evt)//GEN-FIRST:event_jFormattedTextField1FocusGained
    {//GEN-HEADEREND:event_jFormattedTextField1FocusGained
      jFormattedTextField1.setVerifyInputWhenFocusTarget(true);
    }//GEN-LAST:event_jFormattedTextField1FocusGained

    private void jFormattedTextField1KeyPressed(java.awt.event.KeyEvent evt)//GEN-FIRST:event_jFormattedTextField1KeyPressed
    {//GEN-HEADEREND:event_jFormattedTextField1KeyPressed
      int key = evt.getKeyCode();

      if ( (key == KeyEvent.VK_DELETE) || (key == KeyEvent.VK_BACK_SPACE) || (key == KeyEvent.VK_TAB) )
        jFormattedTextField1.setVerifyInputWhenFocusTarget(false);
      else
        jFormattedTextField1.setVerifyInputWhenFocusTarget(true);

      System.out.println(key);
      System.out.println( jFormattedTextField1.getVerifyInputWhenFocusTarget() );
    }//GEN-LAST:event_jFormattedTextField1KeyPressed

    protected void closeKontaktWindow()
    {
      dispose();
    }

    private void alumnusCheck()
    {
      int ySetzen = jPanel6.getHeight() + 14; // 14 scheint der nb6.8 - Platz-Puffer zu sein

      if (!jCheckBox5.isSelected())
      {
        jLabel16.setVisible(false);
        jLabel17.setVisible(false);
        jTextField13.setVisible(false);
        jTextField14.setVisible(false);
        ySetzen += jPanel6.getY();
        jPanel5.setSize(jPanel5.getWidth(), ySetzen);
      }
      else
      {
        jLabel16.setVisible(true);
        jLabel17.setVisible(true);
        jTextField13.setVisible(true);
        jTextField14.setVisible(true);
        ySetzen += jPanel6.getY();
        jPanel5.setSize(jPanel5.getWidth(), ySetzen);
      }
    }

  // Variables declaration - do not modify//GEN-BEGIN:variables
  private javax.swing.JButton jButton1;
  private javax.swing.JButton jButton2;
  protected javax.swing.JButton jButton3;
  private javax.swing.JButton jButton4;
  protected javax.swing.JButton jButton5;
  private javax.swing.JButton jButton6;
  private javax.swing.JButton jButton7;
  private javax.swing.JCheckBox jCheckBox1;
  private javax.swing.JCheckBox jCheckBox2;
  private javax.swing.JCheckBox jCheckBox3;
  private javax.swing.JCheckBox jCheckBox4;
  private javax.swing.JCheckBox jCheckBox5;
  private javax.swing.JFormattedTextField jFormattedTextField1;
  private javax.swing.JLabel jLabel1;
  private javax.swing.JLabel jLabel10;
  private javax.swing.JLabel jLabel11;
  private javax.swing.JLabel jLabel12;
  private javax.swing.JLabel jLabel13;
  private javax.swing.JLabel jLabel14;
  private javax.swing.JLabel jLabel15;
  private javax.swing.JLabel jLabel16;
  private javax.swing.JLabel jLabel17;
  private javax.swing.JLabel jLabel18;
  private javax.swing.JLabel jLabel19;
  private javax.swing.JLabel jLabel2;
  private javax.swing.JLabel jLabel20;
  private javax.swing.JLabel jLabel21;
  private javax.swing.JLabel jLabel22;
  private javax.swing.JLabel jLabel23;
  private javax.swing.JLabel jLabel24;
  private javax.swing.JLabel jLabel25;
  private javax.swing.JLabel jLabel26;
  private javax.swing.JLabel jLabel27;
  private javax.swing.JLabel jLabel28;
  private javax.swing.JLabel jLabel29;
  private javax.swing.JLabel jLabel3;
  private javax.swing.JLabel jLabel30;
  private javax.swing.JLabel jLabel31;
  private javax.swing.JLabel jLabel4;
  private javax.swing.JLabel jLabel5;
  private javax.swing.JLabel jLabel6;
  private javax.swing.JLabel jLabel7;
  private javax.swing.JLabel jLabel8;
  private javax.swing.JLabel jLabel9;
  private javax.swing.JPanel jPanel1;
  private javax.swing.JPanel jPanel10;
  private javax.swing.JPanel jPanel2;
  private javax.swing.JPanel jPanel3;
  private javax.swing.JPanel jPanel4;
  private javax.swing.JPanel jPanel5;
  private javax.swing.JPanel jPanel6;
  private javax.swing.JPanel jPanel7;
  private javax.swing.JPanel jPanel8;
  private javax.swing.JPanel jPanel9;
  private javax.swing.JTabbedPane jTabbedPane1;
  private javax.swing.JTextField jTextField1;
  private javax.swing.JTextField jTextField10;
  private javax.swing.JTextField jTextField11;
  private javax.swing.JTextField jTextField12;
  private javax.swing.JTextField jTextField13;
  private javax.swing.JTextField jTextField14;
  private javax.swing.JTextField jTextField15;
  private javax.swing.JTextField jTextField16;
  private javax.swing.JTextField jTextField17;
  private javax.swing.JTextField jTextField18;
  private javax.swing.JTextField jTextField19;
  private javax.swing.JTextField jTextField2;
  private javax.swing.JTextField jTextField20;
  private javax.swing.JTextField jTextField21;
  private javax.swing.JTextField jTextField22;
  private javax.swing.JTextField jTextField23;
  private javax.swing.JTextField jTextField24;
  private javax.swing.JTextField jTextField3;
  private javax.swing.JTextField jTextField4;
  private javax.swing.JTextField jTextField5;
  private javax.swing.JTextField jTextField6;
  private javax.swing.JTextField jTextField7;
  private javax.swing.JTextField jTextField8;
  private javax.swing.JTextField jTextField9;
  // End of variables declaration//GEN-END:variables

}
